<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}" />
<link rel="stylesheet" type="text/css" th:href="@{/My97DatePicker/skin/WdatePicker.css}"/>
<head th:include="fragments/head::header" />
<style>
    .error {
        color: #F00
    }
</style>
<body>
<div th:include="fragments/top::top"></div>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div th:include="fragments/left::left" class="sidebar" id="sidebar"></div>
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>控制台</li>
                    <li>管理层查看</li>
                    <li>签证申请列表</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <div class="col-xs-12">
                                <div th:include="fragments/student_info::student_info" th:style="${session.studentInfoKey == null}? 'display:none'"></div>
                                <h3 class="header smaller lighter blue">签证申请列表</h3>
                                <div class="table-header" style="height:178px">
                                    <form class="form-inline">
                                        <label>学号：</label>
                                        <input type="text" id="input_studentNo" class="form-control input-sm"  style="width:70px;height: 25px;"/>
                                        <label style="margin-left: 15px;">姓名：</label>
                                        <input type="text" id="input_studentName" class="form-control" style="width:70px;height: 25px;" />
                                        <div class="form-group" style="margin-left: 15px;">
                                            <label>文签顾问：</label>
                                            <input type="text" id="input_copyOperator" class="form-control input-sm"  style="width:70px;height: 25px;"/>
                                        </div>
                                        <label style="margin-left: 15px;">国家：</label>
                                        <select id="select_nation" class="form-control input-sm" style="height: 25px;width:150px;">
                                            <option value="-999">请选择</option>
                                            <option th:each="item: ${countryList}" th:value="${item.id}" th:text="${item.countryName}"></option>
                                        </select>
                                        <div class="form-group" style="margin-left: 15px;">
                                            <label>签约分支：</label>
                                            <select id="select_branch" class="form-control input-sm" style="height: 25px;width:150px;">
                                                <option value="-999">全部</option>
                                                <option th:each="item: ${branchList}" th:value="${item.branchId}" th:text="${item.branchName}"></option>
                                            </select>
                                        </div>
                                        <button type="button" id="query" class="btn btn-success pull-right">查询</button>
                                        <button  class="btn btn-warning pull-right">清空</button>

                                        <br/>
                                        <div class="form-group" >
                                            <label>签证申请提交日期：</label>
                                            <input type="text" id="input_createDateBegin" class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00'})" style="width:130px; height:25px"/>
                                            -
                                            <input type="text" id="input_createDateEnd" class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59'})" style="width:130px; height:25px"/>
                                        </div>
                                        <div class="form-group" style="margin-left: 15px;">
                                            <label>签证结果提交日期：</label>
                                            <input type="text" id="input_visaResultCreateDateBegin" class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00'})" style="width:130px; height:25px"/>
                                            -
                                            <input type="text" id="input_visaResultCreateDateEnd" class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59'})" style="width:130px; height:25px"/>
                                        </div>
                                        <br/>

                                        <label>签证申请是否审批：</label>
                                        <select id="select_isAudited" class="form-control input-sm" style="height: 25px;width:80px;">
                                            <option value="-999">请选择</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                        <div class="form-group" style="margin-left: 15px;">
                                            <label>签证分类：</label>
                                            <select id="select_studentVisaStatus" class="form-control input-sm" style="height: 25px;width:100px;">
                                                <option value="-999">全部</option>
                                                <option value="1">学生签证</option>
                                                <option value="0">非学生签证</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-left: 75px;">
                                            <label>送件日期：</label>
                                            <input type="text" id="input_sendDateBegin" class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00'})" style="width:130px; height:25px"/>
                                            -
                                            <input type="text" id="input_sendDateEnd"  class="form-control input-sm" onclick="WdatePicker({dateFmt:'yyyy-MM-dd 23:59:59'})" style="width:130px; height:25px"/>
                                        </div>
                                        <br/>


                                        <div class="form-group">
                                            <label>是否有签证结果：</label>
                                            <select id="select_hasVisaResult" class="form-control input-sm" style="height: 25px;width:80px;">
                                                <option value="-999">请选择</option>
                                                <option value="1">是</option>
                                                <option value="0">否</option>
                                            </select>
                                        </div>
                                        <div class="form-group" style="margin-left: 15px;">
                                            <label>签证结果是否审批：</label>
                                            <select id="select_visaResultIsAudited" class="form-control input-sm" style="height: 25px;width:80px;">
                                                <option value="-999">请选择</option>
                                                <option value="1">是</option>
                                                <option value="0">否</option>
                                            </select>
                                        </div>

                                    </form>
                                </div>
                                <div class="table-responsive">
                                    <div id="alert" class="alert alert-success" style="display: none;" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                        <span id="alertText"></span>
                                    </div>
                                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <th>学号</th>
                                            <th>姓名</th>
                                            <th>文签顾问</th>
                                            <th>国家</th>
                                            <th>签约分支</th>

                                            <th>是否审批</th>
                                            <th>签证分类</th>
                                            <th>签证方式</th>
                                            <th>送件日期</th>
                                            <th>提交日期</th>
                                            <th>提交人</th>

                                            <th>是否有签证结果</th>
                                            <th>签证结果是否审批</th>
                                            <th>签证结果提交日期</th>
                                            <th>详情</th>
                                        </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div th:include="fragments/bottom::bottom"></div>
    </div>
    <a href="#" id="btn-scroll-up"
       class="btn-scroll-up btn btn-sm btn-inverse"> <i
            class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>
<!-- Modal备注 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content"></div>
    </div>
</div>
<div th:include="fragments/js::js"></div>
<script th:src="@{/assets/js/jquery.validate.min.js}"></script>
<script th:src="@{/assets/js/jquery.validate.zh-CN.js}"></script>
<!-- page specific plugin scripts -->
<script th:src="@{/assets/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script th:src="@{/assets/js/temp.js}" charset="UTF-8"></script>
<script th:src="@{/assets/js/date-time/moment.min.js}"></script>
<script th:src="@{/business/common.js}"></script>
<!--图片查看器-->
<script th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script th:src="@{/layer/layer.js}"></script>
<script th:src="@{/My97DatePicker/WdatePicker.js}"></script>
<script type="text/javascript">
    <!--
    jQuery(function($) {
        var pageHelper = (function(){
            return{
                init:function(){
                    this.getQueryData();
                    this.handelQueryData();
                    this.render();
                    this.addEvent();

                },
                getQueryData:function(){
                    this.oTable1;
                },
                handelQueryData:function(){

                },
                render:function(){
                    var _self = this;
                    _self.oTable1 = $('#sample-table-2').dataTable({
                        "bFilter" : false,//是否使用搜索
                        "bProcessing" : true,
                        "bDeferRender" : true,//
                        "sPaginationType" : "bs_normal",//分页样式
                        "bRetrieve" : true,//是否调用后台
                        "bServerSide" : true,//是否以后台分页
                        "sAjaxSource" : "/visaApply/manageList/query",//请求路径
                        "fnServerData" : function(sSource, aoData, fnCallback) {
                            aoData.push(
                                {"name": "studentNo", "value": $("#input_studentNo").val()},
                                {"name": "studentName", "value": $("#input_studentName").val()},
                                {"name": "copyOperator", "value": $("#input_copyOperator").val()},
                                {"name": "nationId", "value": $("#select_nation").children("option:selected").val()},
                                {"name": "branchId", "value": $("#select_branch").children("option:selected").val()},

                                {"name": "isAudited", "value": $("#select_isAudited").children("option:selected").val()},
                                {"name": "studentVisaStatus", "value": $("#select_studentVisaStatus").children("option:selected").val()},
                                {"name": "sendDateStart", "value": $("#input_sendDateBegin").val()},
                                {"name": "sendDateEnd", "value": $("#input_sendDateEnd").val()},
                                {"name": "createDateStart", "value": $("#input_createDateBegin").val()},
                                {"name": "createDateEnd", "value": $("#input_createDateEnd").val()},

                                {"name": "hasVisaResult", "value": $("#select_hasVisaResult").children("option:selected").val()},
                                {"name": "visaResultIsAudited", "value": $("#select_visaResultIsAudited").children("option:selected").val()},
                                {"name": "visaResultCreateDateStart", "value": $("#input_visaResultCreateDateBegin").val()},
                                {"name": "visaResultCreateDateEnd", "value": $("#input_visaResultCreateDateEnd").val()}
                            )
                            $.ajax({
                                "dataType" : 'json',
                                "type" : "GET",
                                "url" : sSource,
                                "data" : aoData,
                                "success" : fnCallback
                            });
                        },
                        "aaSorting" : [ [ 1, "desc" ] ],
                        "aoColumns" : [
                            {"sClass": "center", "bSortable": false, "mData": "student_no",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        return "<a href='/student/detail?studentNo=" + data + "' target='_blank'>" + data + "</a>";
                                    } else {
                                        return "";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "student_name"},
                            {"sClass": "center", "bSortable": false, "mData": "copy_operator"},
                            {"sClass": "center", "bSortable": false, "mData": "nation_name"},
                            {"sClass": "center", "bSortable": false, "mData": "branch_name"},

                            {"sClass": "center", "bSortable": false, "mData": "apply_audit_status",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        if(data == "1" || data == "2"){
                                            return "否";
                                        }else{
                                            return "是";
                                        }
                                    } else {
                                        return "-";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "student_visa_status",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        if(data == "1"){
                                            return "学生签证";
                                        }else if(data == "0"){
                                            return "非学生签证";
                                        }
                                    } else {
                                        return "";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "visa_way",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        if(data == "1"){
                                            return "电签";
                                        }else if(data == "2"){
                                            return "普签";
                                        }
                                    } else {
                                        return "";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "send_date",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        return moment(data).format("YYYY-MM-DD");
                                    } else {
                                        return "";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "create_time",
                                "mRender" : function(data, type, full, meta) {
                                    if(data != null && data != ''){
                                        return  moment(data).format("YYYY-MM-DD");
                                    }
                                    else
                                        return "";
                                }
                            },
                            {
                                "sClass": "center", "bSortable": false, "mData": "operator_name",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        return data;
                                    } else {
                                        return "";
                                    }
                                }
                            },

                            {
                                "sClass": "center", "bSortable": false, "mData": "visa_id",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        return "有";
                                    } else {
                                        return "无";
                                    }
                                }
                            },
                            {
                                "sClass": "center", "bSortable": false, "mData": "visa_status",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        if(data == 3 || data == 4){
                                            return "是";
                                        }
                                        else if(data == 1 || data == 2){
                                            return "否";
                                        }
                                    } else {
                                        return "-";
                                    }
                                }
                            },
                            {
                                "sClass": "center", "bSortable": false, "mData": "visaResult_createTime",
                                "mRender" : function(data, type, full, meta) {
                                    if (data != null && data != '') {
                                        return moment(data).format("YYYY-MM-DD");
                                    } else {
                                        return "-";
                                    }
                                }
                            },

                            {
                                "sClass": "center", "bSortable": false, "mData": function (data) {
                                return "<a href='/visaApply/detailPage?id=" + data.id + "&studentNo=" + data.student_no + "' target='_blank'>详情</a>";
                                }
                            }
                        ],
                        "oLanguage" : {
                            "sLengthMenu" : "每页 _MENU_条 ",
                            "sZeroRecords" : "对不起，查询不到任何相关数据",
                            "sInfo" : "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                            "sInfoEmpty" : "显示 0 到 0 条，共 0 条记录",
                            "sInfoFiltered" : "数据表中共为 _MAX_ 条记录)",
                            "sProcessing" : "正在加载中...",
                            "sSearch" : "搜索",
                            "sUrl" : "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                            "oPaginate" : {
                                "sFirst" : "第一页",
                                "sPrevious" : " 上一页 ",
                                "sNext" : " 下一页 ",
                                "sLast" : " 最后一页 "
                            }
                        }
                        //多语言配置
                    });
                },
                addEvent:function(){
                    var _self = this;
                    $("#query").click(function() {
                        _self.oTable1.fnDraw();
                    });
                }
            }
        })();
        pageHelper.init();
    });
    -->
</script>
</body>
</html>